<#include "../common/header.html">

<body class="skin-blue fixed sidebar-mini" style="height: auto; min-height: 100%;">
<div class="wrapper" style="height: auto; min-height: 100%;">
    <#assign page_tab="question">
    <#assign page_nav="questionlist">
    <#include "content_menu.html">

    <!--右侧内容 开始-->
    <div id="admin_right" class="content-wrapper">
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="home-icon fa fa-home"></i>
                    <a href="/system/index">系统</a>
                </li>
                <li>
                    <a href="/system/question/list_question">问答管理</a>
                </li>
                <li class="active">问答列表</li>
            </ul>
        </div>
        <@fly_questionpage p="${p!}">
        <div class="content">
            <form name='right_list' method='post' action='/system/right_update/recycle/del'>
                <table class="table list-table">
                    <colgroup>
                        <col width="35px" />
                        <col width="280px" />
                        <col width="200px" />
                        <col />
                        <col />
                        <col />
                        <col />
                        <col width='300px' />
                    </colgroup>
                    <caption>
                        <a class="btn btn-default" id="selectAll">
                            <i class="fa fa-check"></i>全选
                        </a>
                        <a class="btn btn-default" id="indexAllquestion">
                            <i class="fa fa-book"></i>全部索引
                        </a>
                        <a class="btn btn-default">
                            <i class="fa fa-close"></i>批量删除
                        </a>
                    </caption>
                    <thead>
                    <tr>
                        <th>选择</th>
                        <th>标题</th>
                        <th>发布人</th>
                        <th>推荐</th>
                        <th>发布时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody>
                    <#list question_page.list as list>
                    <tr>
                        <td><input name="questionId" type="checkbox" value="${list.id}" /></td>
                        <td>${list.title!}</td>
                        <td><@fly_userinfo userId="${list.userId!}">${userinfo.nickName!}</@fly_userinfo></td>
                        <td class="center">
                            <#if list.recommend == 0>
                            <span class="pull-right-container">
                                <small class="label label-default">不推荐</small>
                            </span>
                            <#elseif list.recommend == 1>
                            <span class="pull-right-container">
                                <small class="label bg-yellow">内容页推荐</small>
                            </span>
                            <#elseif list.recommend == 2>
                            <span class="pull-right-container">
                                <small class="label bg-aqua">栏目页推荐</small>
                            </span>
                            <#elseif list.recommend == 3>
                            <span class="pull-right-container">
                                <small class="label bg-light-blue">专题页推荐</small>
                            </span>
                            <#elseif list.recommend == 4>
                            <span class="pull-right-container">
                                <small class="label bg-green">首页推荐</small>
                            </span>
                            <#elseif list.recommend == 5>
                            <span class="pull-right-container">
                                <small class="label label-danger">全站推荐</small>
                            </span>
                            </#if>
                        </td>
                        <td class="word-wrap">${list.createTime?string('yyyy-MM-dd')}</td>
                        <td class="word-wrap">
                            <#if list.status == 0>
                            未审核
                            <#elseif list.status == 1>
                            正常
                            <#elseif list.status == 2>
                            未通过
                            <#elseif list.status == 3>
                            已删除
                            </#if>
                        </td>
                        <td>
                            <a href="javascript:;" class="info-status" data-id="${list.id}" data-toggle="modal" data-target="#statusModal"><i class='fa fa-cog'></i><span>审核</span> </a>
                            <a href="/system/category/update/${list.id}"><i class='fa fa-edit'></i>编辑 </a>
                            <a  data-title="${list.title!}" data-id="${list.id}" class="question-delete"> <i class='fa fa-close'></i>删除 </a>
                        </td>
                    </tr>
                    </#list>
                    </tbody>
                </table>
                <div class="text-center">
                    <ul class="pagination">
                        ${question_page.pageNumHtml}
                    </ul>
                </div>
            </form>
        </div>
    </@fly_questionpage>
    </div>
    <!--右侧内容 结束-->
</div>
<div class="modal fade" id="statusModal" tabindex="-1" role="dialog" aria-labelledby="statusModalLabel" aria-hidden="true">>
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">审核</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="status0" class="control-label">状态</label>
                    <p>
                        <label class="radio-inline">
                            <input type="radio" name="status" id="status0" value="0">
                            未审核
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" id="status1" value="1">
                            正常
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" id="status2" value="2">
                            未通过
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" id="status3" value="3">
                            删除
                        </label>
                    </p>
                </div>
                <div class="form-group">
                    <label for="recommend" class="control-label">推荐设置</label>
                    <select name="recommend" class="form-control" id="recommend">
                        <option value="0">不推荐</option>
                        <option value="1">内容页推荐</option>
                        <option value="2">栏目页推荐</option>
                        <option value="3">专题页推荐</option>
                        <option value="4">首页推荐</option>
                        <option value="5">全站推荐</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <input name="id" id="id" value="" type="hidden">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary status-btn" data-dismiss="modal">保存</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script type="text/javascript">seajs.use('content', function(content) {});</script>
</body>
</html>